import 'package:flutter/cupertino.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Util/PageUtil.dart';
import 'package:imember/Widget/MyButton.dart';
import 'package:imember/Widget/MyDialog.dart';
import 'package:imember/Widget/MyImage.dart';
import 'package:imember/Widget/MyInput.dart';

class ScanReceiveConfirm extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _ScanReceiveConfirm();
  }
}

class _ScanReceiveConfirm extends State {
  List<String> orderList = ["","","",""];

  @override
  Widget build(BuildContext context) {
    List<Widget> itemOrderList = [];
    for (var i = 0; i < orderList.length; i++) {
      itemOrderList.add(ItemOrder());
    }
    return Container(
        color: MyColor.White,
        width: 600,
        child: SingleChildScrollView(
            child: Column(mainAxisSize: MainAxisSize.min, children: [
          Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
            LocalImage("ic_back_g.png", width: 48, onTap: () {
              PageUtil().back(context);
            }),
            Text("掃描領貨", style: TextStyle(fontSize: 20, color: MyColor.C51)),
            Container(width: 48),
          ]),
          Container(height: 1, color: MyColor.C4),
          Column(mainAxisSize: MainAxisSize.min, children: itemOrderList),
          OrangeBtn("領貨", width: 170, height: 37, margin: EdgeInsets.fromLTRB(0, 38, 0, 26),onTap: (){
            PageUtil().back(context);
            showBtn1Dialog(context, "領貨成功", "確認", (){});
          })
        ])));
  }
}

class ItemOrder extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.only(top: 12),
        child: Column(
          children: [
            Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [
              Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
                Text("訂單編號: 113856", style: TextStyle(fontSize: 15, color: MyColor.C51, height: 2)),
                Text("導遊名稱: 王曉明", style: TextStyle(fontSize: 15, color: MyColor.C51, height: 2)),
                Text("顧客名稱: 陳明聰", style: TextStyle(fontSize: 15, color: MyColor.C51, height: 2)),
              ]),
              Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
                Text("總箱數: 10", style: TextStyle(fontSize: 15, color: MyColor.C51, height: 2)),
                Text("連絡電話: 0912312312", style: TextStyle(fontSize: 15, color: MyColor.C51, height: 2)),
              ])
            ]),
            Container(height: 1, color: MyColor.C9, margin: EdgeInsets.only(top: 12))
          ],
        ));
  }
}
